<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model as BaseModel;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class AdminRoleModel extends BaseModel
{
    use HasFactory, SoftDeletes;

    protected $table = 't_admin_role';

    protected $primaryKey = 'id';

    public $timestamps = true;

    const CREATED_AT = 'created_at';
    
    const UPDATED_AT = null;

    // protected $fillable = [];

    protected $guarded = [];

    //内置角色id
    const ADMIN_ID = 1;
    const DRIVER_ID = 2;

    protected $hidden = [
        'deleted_at',
    ];

    public function admin(): BelongsTo
    {
        return $this->belongsTo(AdminModel::class, 'created_admin_id');
    }

}
